#ifndef __CONTROL_H__
#define __CONTROL_H__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "head.h"
#include "Control.h"
#include "SQLiteManager.h"


int regist(char* name, char* passwd);
extern int init();

extern int regist(char* name, char* passwd);

extern int login(char* name, char* passwd);

extern int update_passwd(char* name, char* new_passwd);

extern int add_user_info(UserInfo* userinfo);

extern int update_user_info(UserInfo* userinfo);

extern int delete_user(char* name);

//you malloc
extern int query_all_user_info(UserInfo* userinfo, int len);
extern int get_user_count();

extern int query_user_info_by_name(char* name, UserInfo* user_info);

//you malloc
extern int query_all_history(HistoryInfo* history_info, int len);
extern int get_history_count();

//you malloc
extern int query_history_by_name(char* name, HistoryInfo* history_info, int len);
extern int get_history_by_name_count(char* name);

extern int add_history(HistoryInfo* history_info);

#endif
